package com.mf.controller;

import java.util.List;

import com.mf.entity.Msg;
import com.mf.entity.User;
import com.mf.service.UserService;

public class UserController {
	
	UserService userService=new UserService();
	
	public Msg allUser(){
		List< User> list=userService.selectAll();
		return Msg.success().add("userList", list);
	}
	
	public Msg updateUser(User user){
		userService.update(user);
		return Msg.success();
	}
	
	public Msg delUser(String id){
		User user=new User();
		user.setId(Integer.parseInt(id));
		userService.delete(user);
		return Msg.success();
	}
	
}
